function pager(pageindex, pagesize, count, showid, fun) {
    //设置如果当前分页小于1,则设为第一页
    if (pageindex < 1) { pageindex = 1; }
    str = "";
    //获得总分页数
    if (count % pagesize == 0) {
        pagecount = parseInt(count / pagesize);
    } else {
        pagecount = parseInt(count / pagesize + 1);
    }
    //设置如果当前分页大于总分页数,则当前分页为总分页数

    if (pageindex > pagecount && pagecount > 0) {
        pageindex = pagecount;
    }
    //显示第一页
    if (pageindex > 1) {
       str += "<a href=\"javascript:"+fun+eval(1)+")\"  style=\"text-decoration:none;color:#e31f4a;\"><li class=\"myorder-li-page\"> 首页 </li></a> <a href=\"javascript:"+fun+eval(pageindex-1)+")\" style=\"text-decoration:none;color:#e31f4a;\"><li class=\"myorder-li-page\"> <上一页 </li></a>";
    }

    k = 0; //分页样式中间显示的条数索引
    y = 0; //是否已显示前端符号

    for (var i = 1; i <= pagecount; i++) {
        if (i == 1 && i != pageindex) {
            str += "<a href=\"javascript:" +fun+eval(1)+ ")\"  style=\"text-decoration:none;color:#666666;\"><li class=\"myorder-li-page\">" + i + "</li></a> ";
        } else {
            if (k < 6) {
                if (eval(pageindex - i) > 2 && eval(i + 4) < pagecount) {
                    if (y == 0) { str += ".."; y++; }
                    str += "";
                } else {
                	if (pagecount ==1) {
                   
                	} else if (i == pageindex) {
                        str += "<a style=\"text-decoration:none;color:#e31f4a\"  style=\"text-decoration:none;color:#666666;\"><li class=\"myorder-li-page current\">" + i + "</li></a> ";
                    } else {
                    str += "<a href=\"javascript:" + fun + eval(i)+")\" style=\"text-decoration:none;color:#666666;\"><li class=\"myorder-li-page\">" + i + "</li></a> ";
                    }
                    k++;
                }
            } else {
                str += "..<a href=\"javascript:" + fun + eval(pagecount)+ ")\" style=\"text-decoration:none;color:#666666;\"><li class=\"myorder-li-page\">" + pagecount + "</li></a> ";
                break;
            }

        }
    }
    if (pageindex == pagecount || pagecount == 0) {
        str += "";
    } else {
        str += "<a href=\"javascript:" + fun+ eval(pageindex + 1) + ")\" style=\"text-decoration:none;color:#e31f4a;\"><li class=\"myorder-li-page\">下一页></li></a><a  href=\"javascript:" + fun + eval(pagecount) + ")\" style=\"text-decoration:none;color:#e31f4a;\"><li class=\"myorder-li-page\"> 尾页</li></a> ";
    }
    
    $("#" + showid).html(str);
}